home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Communications / Converse / Source / IconAnimator.h < prev    next >
Text File  |  1995-12-12  |  2KB  |  65 lines

  1. //** Craig Laurent
  2. #import <appkit/appkit.h>
  3. #import <eointerface/eointerface.h>
  4.  
  5. /* IconAnimator - an Object to animate the icon for an application.  This Object will allow similiar activity to NeXTMail when new mail arrives.  Pass in an array of NXImages, an array of NSNumbers indicating the pattern, and the number of loops through the pattern to execute.  The time interval between image changes, and the stopAnimation icon can be set after initialization.
  6. imageArray - an array of NXImages to be placed in the icon one at a time.
  7. animationPattern - an array of NSNumbers.  Each number indicates which image number (objectAt:) should be displayed.  The order of the numbers will reflect the pattern of the animation.
  8. patternLoops - the number of times that the animationPattern will be looped through.
  9. timeInterval - the time interval between image changes.  Defaults to 0.2 seconds.  See setTimeInterval: method.
  10. indexOfEndIcon - the index of the icon to be displayed at the end of the animation cycle.  Defaults to 1.  See setIndexOfEndIcon: method.
  11. indexOfStopIcon - the index of the icon to be displayed after stopAnimation:.  Defaults to 0.  See setIndexOfStopIcon: method.
  12. */
  13.  
  14. @interface IconAnimator:NSObject
  15. {
  16.     NXImage    *appTile;
  17.     View    *appIconContentView;
  18.  
  19.     NSMutableArray    *animationPattern;
  20.     NSMutableArray    *imageArray;
  21.     int    patternLoops;
  22.     float    timeInterval;
  23.     int    indexOfEndIcon;
  24.     int    indexOfStopIcon;
  25.  
  26.     DPSTimedEntry    timedEntry;
  27.     int    patternIterator;
  28.     int    loopCount;
  29.     int    patternEnd;
  30.     int    offset;
  31. }
  32.  
  33. void Animate (DPSTimedEntry timedEntry, double  now, void *who);
  34.  
  35. - init;
  36. - initWithImageArray:(NSArray*)anArray animationPattern:(NSArray*)patternArray andPatternLoops:(int)loops;    //designated initializer
  37. - (void)dealloc;
  38.  
  39. //** instance methods
  40. - (NSArray*)imageArray;
  41. - (void)setImageArray:(NSArray*)anArray;
  42. - (NSArray*)animationPattern;
  43. - (void)setAnimationPattern:(NSArray*)anArray;
  44. - (int)patternLoops;
  45. - (void)setPatternLoops:(int)numLoops;
  46. - (float)timeInterval;
  47. - (void)setTimeInterval:(float)interval;
  48. - (int)indexOfEndIcon;
  49. - (void)setIndexOfEndIcon:(int)endIcon;
  50. - (int)indexOfStopIcon;
  51. - (void)setIndexOfStopIcon:(int)stopIcon;
  52.  
  53. //** methods to change Animation
  54. - (void)startAnimation:sender;
  55. - (void)stopAnimation;
  56.  
  57.  
  58. //** Internal methods
  59. - (void)removeTimedEntry;
  60. - (NXPoint)cornerPointForImage:(NXImage*)anImage;
  61. - (void)displayImage:(NXImage*)anImage;
  62. - (void)animateIcon;
  63.  
  64. @end
  65.